<?php

// add shortcode contact form
function contact_form_ws24h_shortcode_func( $atts )
{
	global $wpdb,$myoptions;
		
	extract( shortcode_atts( array(
	'title' => ''
	), $atts ) );
		
	$html = '
			<div class="grid_24 block">
	            <div class="contact_info content_detail">';	               
	               				
				if($myoptions['contact-companyname'])
					$html .= '<p><strong style="text-transform:uppercase">'.$myoptions['contact-companyname'].'</strong></p>';
				
				if($myoptions['contact-adress'])
					$html .= '<p>Địa chỉ : '.$myoptions['contact-adress'].'</p>';
				
				if($myoptions['contact-phone'])
					$html .= '<p>Điện thoại : '.$myoptions['contact-phone'].'</p>';
				
				if($myoptions['contact-fax'])
					$html .= '<p>Fax : '.$myoptions['contact-fax'].'</p>';
				
				if($myoptions['contact-email'])
					$html .= '<p>Email : '.$myoptions['contact-email'].'</p>';
	$html .= '			
	            </div>
	            <div class="clear"></div>
	            <div class="contact_form fleft">
	                <div class="form_detail form">
	                    <div class="content">
	                        <div class="clear"></div>
	                        <div class="content_detail">
	                            <form accept-charset="utf-8" method="post" action="">       
	                                <table class="table" style="float: left;padding-bottom: 10px;width: 100%;">
	                                    <tbody>
	                                        <tr>
	                                            <td class="right bold">Họ và tên : </td>
	                                            <td><input type="text" name="mname" id="mname" value="" maxlength="30" style="width: 300px;"> <span>*</span><div id="lname" class="text_error"></div></td>
	                                        </tr>
	                                        <tr>
	                                            <td class="right bold">Email : </td>
	                                            <td><input type="text" name="memail" id="memail" value="" style="width: 300px;" maxlength="50"> <span>*</span><div id="lemail" class="text_error"></div></td>
	                                        </tr>
	                                        <tr>
	                                            <td class="right bold">Điện thoại : </td>
	                                            <td><input type="text" name="mphone" id="mphone" value="" style="width: 300px;" maxlength="50"> <span>*</span><div id="lphone" class="text_error"></div></td>
	                                        </tr>
	                                        <tr>
	                                            <td class="right bold" style="vertical-align: top">Nội dung : </td>
	                                            <td><textarea name="mcontent" id="mcontent" cols="40" rows="10" style="height: 150px; width: 375px;"></textarea> <div id="lcontent" class="text_error"></div></td>
	                                        </tr>
	                                        <tr>
	                                            <td class="right bold">Mã an toàn : </td>
	                                            <td><input type="text" name="security_code" id="security_code" value="" size="35" maxlength="10"> <span>*</span>
	                                            
												<img style="float: left; height: 26px;" class="maantoan" src="'.get_bloginfo("template_url").'/admins/captcha/index.php" alt="" /> <div id="lsecurity_code" class="text_error"></div>
												</td>
	                                        </tr>
	                                        <tr>
												<td></td>			
	                                            <td>
	                                            <input type="button" class="input_button blue_gradient" id="btn-contact-form-send" value="Gửi liên hệ với chúng tôi">
	                                            </td>
	                                        </tr>
											<tr>
												<td></td>			
	                                            <td>
	                                            	<div id="lprocess" class="text_error"> </div>
	                                            </td>
	                                        </tr>			
	                                    </tbody>
	                                </table>
	                            </form>
	                        </div>
	                    </div>
	                </div> 
	            </div>
	            <div class="gmap fright">
					<p>									
	                '.$myoptions['g-map-embed'].'
	                </p>		
	            </div>
	        </div>
			';
	$html .= '<script type="text/javascript" src="'.get_bloginfo('template_url').'/admins/contact/contact.js"></script>';
	return $html;
}

add_shortcode( 'contact-form-ws24h', 'contact_form_ws24h_shortcode_func' );